<?php
/**
 * Created by PhpStorm.
 * User: Inhere
 * Date: 2015/2/15
 * Time: 20:31
 * Use :
 * File: LoggerServiceProvider.php
 */

namespace ulue\base\providers;


use logs\FileLogger;
use ulue\core\ioc\Container;

class LoggerServiceProvider extends AbstractConfigurableServiceProvider
{
    /**
     * 注册日志服务提供者， LoggerServiceProvider
     * @param  Container $container 传入容器
     * @throws \DInvalidArgumentException
     * @return mixed|void
     */
    public function register(Container $container)
    {
        $options = $this->options;

        $container->share( 'logger', function(Container $container) use($options)
        {
            return new FileLogger($options);
        }
        )->alias('system.logger')->alias('app.logger')->alias('log');
    }

}// end class LoggerServiceProvider